/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.LSPCompliance.Impl;

import za.ac.cput.LSPCompliance.AccountIntrfc;

/**
 *
 * @author Leo
 */
public class CheqAccnt implements AccountIntrfc {
    protected int balance;

protected int period;

public CheqAccnt(){
}
public CheqAccnt(int bal, int per) {
this.balance = bal;
this.period = per;
}

public boolean openAccount(int bal)
{
this.balance = bal;
return true;
}
/**
*closes the account
*/
public boolean closeAccount()
{
if(balance >0)
    return true;  
    else
    return false;
}

public int getBalance() {
return this.balance;
}

public void setBalance(int balance) {
this.balance = balance;
}
public int getPeriod() {
    
return this.period;
}

public void setPeriod(int period) {
    
this.period = period;
}
    @Override
    public void closeAnAccount(CheqAccnt acc) {
     System.out.println("Account close :"+acc.closeAccount());
    }
    
}
